<template>
    <div>
        <div class="newsInfo-container">
    <h1 class="title">{{newsinfo.title}}</h1>
    <p class="subtitle">
      <span>发表时间:{{newsinfo.add_time | format}}</span>
      <span>次数: {{newsinfo.click}}次</span>
    </p>
    <hr>

    <div class="container" v-html="newsinfo.content"></div>

    <!-- 评论区 -->
    <!-- <comment-box :id="this.id"></comment-box> -->
    <comments :id="id"></comments>
  </div>
    </div>
</template>

<script>
import  {getnewinfo} from  "@/api";

import  comments  from  "../subcomponents/comment.vue"
export default {
    data(){
       return  {
           newsinfo:{},
            id:this.$route.params.id

       }
    },
    created(){
        getnewinfo(this.id).then(res=>{
            console.log(res.data.message[0],6677);
            this.newsinfo=res.data.message[0];
        })
    },
    components:{
        comments
    }
}
</script>
